using System;
using Microsoft.Xna.Framework;

namespace SpaceKinect
{
    static class Program
    {

    // <summary>
    /// Sample showing how to manage different game states, with transitions
    /// between menu screens, a loading screen, the game itself, and a pause
    /// menu. This main game class is extremely simple: all the interesting
    /// stuff happens in the ScreenManager component.
    /// </summary>
        public class GameMenu : Microsoft.Xna.Framework.Game
        {
            #region Fields

            public static GraphicsDeviceManager graphics;
            ScreenManager screenManager;


            // By preloading any assets used by UI rendering, we avoid framerate glitches
            // when they suddenly need to be loaded in the middle of a menu transition.
            static readonly string[] preloadAssets =
        {
            "gradient",
        };


            #endregion

            #region Initialization


            /// <summary>
            /// The main game constructor.
            /// </summary>
            public GameMenu()
            {
                Content.RootDirectory = "Content";

                graphics = new GraphicsDeviceManager(this);
                graphics.PreferredBackBufferWidth = GlobalVars.windowWidth;
                graphics.PreferredBackBufferHeight = GlobalVars.windowHeight;
                graphics.ApplyChanges();
                Window.Title = "Space Kinect";
                // Create the screen manager component.
                screenManager = new ScreenManager(this);

                Components.Add(screenManager);

                // Activate the first screens.
                screenManager.AddScreen(new BackgroundScreen(), null);
                screenManager.AddScreen(new MainMenuScreen(), null);
            }


            /// <summary>
            /// Loads graphics content.
            /// </summary>
            protected override void LoadContent()
            {
                foreach (string asset in preloadAssets)
                {
                    Content.Load<object>(asset);
                }
            }


            #endregion

            #region Draw


            /// <summary>
            /// This is called when the game should draw itself.
            /// </summary>
            protected override void Draw(GameTime gameTime)
            {
                graphics.GraphicsDevice.Clear(Color.Black);

                // The real drawing happens inside the screen manager component.
                base.Draw(gameTime);
            }


            #endregion
        }

        //With Menu 

         ///<summary>
         //The main entry point for the application.
         ///</summary>
        static void Main(string[] args)
        {
            using (GameMenu game = new GameMenu())
            {
                game.Run();
            }
        }

        //With No menu

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //static void Main(string[] args)
        //{
        //    using (Game1 game = new Game1())
        //    {
        //        game.Run();
        //    }
        //}
    }
}

